#include <iostream>
#include "SortTestHelper.h"
#include "SelectionSort.h"
using namespace std;
template <typename T>
void insertionSort(T arr[],int n){
    for (int i = 1; i < n; ++i) {
        T e=arr[i];
        int j;
        for ( j = i; j > 0 && arr[j - 1]>e; j--)
            arr[j]=arr[j - 1];
        arr[j]=e;
    }
    return;
}
int main() {
    int N=10000;
    int* arr=SortTestHelper::generateRandomArray(N,0,100);
    int* arr2=SortTestHelper::copyArray(arr,N);
    SortTestHelper::testSort("Insert sort",insertionSort,arr2,N);
    SortTestHelper::testSort("Select sort",SelectionSort::SelectionSort,arr,N);
    delete[] arr;
    delete[] arr2;
    return 0;
}